﻿//LimitManager.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Algo.Limits
{
	using System;

	using StockSharp.Algo.Strategies;
	using StockSharp.BusinessEntities;

	public class MaxPositionRule
	{
		
	}

	public class LimitManager
	{
		public decimal MaxPosition { get; set; }

		public decimal MaxDrawdown { get; set; }

		public WorkingTime WorkingTime { get; set; }

		internal void Start(Strategy strategy)
		{
			if (strategy == null)
				throw new ArgumentNullException("strategy");

			if (MaxDrawdown < 0)
			{
				strategy
					.WhenPnLLess(-MaxDrawdown)
					.Do(() => strategy.Stop())
					.Apply(strategy);
			}
			
		}

		//public IMarketRule MaxPosition(decimal maxPosition)
		//{
			
		//}
	}
}